package com.twu.biblioteca;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Raluca Puichilita on 03/08/2014.
 */

public class UserAccount {

    private String name;
    private String email;
    private String phoneNo;

    private String password;
    private String libraryNumber;

    protected List<Book> booksOnLoan = new ArrayList<Book>();
    protected List<Movie> moviesOnLoan = new ArrayList<Movie>();

    public UserAccount(String name, String email, String phoneNo) {
        this.name = name;
        this.email = email;
        this.phoneNo = phoneNo;
    }

    public void listAllItemsOnLoanFromUser() {
        System.out.print("\nYou checked out the following books:\n");
        for (Book thisBook : booksOnLoan)
            System.out.println(thisBook);

        System.out.print("\nYou checked out the following movies:\n");
        for (Movie thisMovie : moviesOnLoan)
            System.out.println(thisMovie);
    }

    public void setUserLibraryNumber(String newLibraryNumber) {
        libraryNumber = newLibraryNumber;
    }

    protected String getUserLibraryNumber() {
        return libraryNumber;
    }

    public void setUserPassword(String newPassword) {
        password = newPassword;
    }

    protected String getUserPassword() {
        return password;
    }

    public String getName() {
        return name;
    }

    public String getEmail() {
        return email;
    }

    public String getPhoneNo() {
        return phoneNo;
    }

    public String toString() {
        return "\nRegistered user information:\nName: " + getName() + "\nEmail address: " + getEmail()
                + "\nPhone Number: " + getPhoneNo() + "\n";
    }
}
